package com.itheima.day13.thread.test17;

import java.util.concurrent.ArrayBlockingQueue;

public class Cooker extends Thread {
    private ArrayBlockingQueue<String> abq;
    public Cooker(ArrayBlockingQueue<String> abq){
        this.abq = abq;
    }


    @Override
    public void run() {
        while(true){
            try {
                abq.put("汉堡包");
                System.out.println("厨师放了一个汉堡包");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
